package cn.gzsxt.po;

import java.util.List;
import java.util.Map;

//分页对象 : 封装了前台页面所需要的全部数据
public class PageCheckResult_name {

	private List<?> dataList;// 分页当前页的数据: 由SQL语句查询出来
	private Integer totalCount;// 总条数 : 由SQL语句查询出来
	private Integer pageSize; // 每页条数: 默认有10条,用户可以自定义条数 10,25,50,100
	private Integer currentPage;// 当前页面 : 默认 第一页,最终用户翻页决定当前条数

	private Integer totalPage; // 总页数 :计算出来 , 总条数/每页条数
	private Integer prePage; // 上一页:计算出来,当前页-1
	private Integer nextPage; // 下一页:计算出来,当前页+1
	private List<Uname> uname;

	public PageCheckResult_name(List<?> dataList, Integer totalCount, Integer pageSize, Integer currentPage) {
		super();
		this.dataList = dataList;
		this.totalCount = totalCount;
		this.pageSize = pageSize;
		this.currentPage = currentPage;

		// 计算
		this.totalPage = totalCount % pageSize == 0 ? totalCount / pageSize : totalCount / pageSize + 1;
		this.prePage = currentPage - 1 > 1 ? currentPage - 1 : 1;
		this.nextPage = currentPage + 1 < totalPage ? currentPage + 1 : totalPage;
	}

	public List<?> getDataList() {
		return dataList;
	}

	public Integer getTotalCount() {
		return totalCount;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public Integer getCurrentPage() {
		return currentPage;
	}

	public Integer getTotalPage() {
		return totalPage;
	}

	public Integer getPrePage() {
		return prePage;
	}

	public Integer getNextPage() {
		return nextPage;
	}

	public List<Uname> getUname() {
		return uname;
	}

	public void setUname(List<Uname> uname) {
		this.uname = uname;
	}

	@Override
	public String toString() {
		return "PageResult_name [dataList=" + dataList + ", totalCount=" + totalCount + ", pageSize=" + pageSize
				+ ", currentPage=" + currentPage + ", totalPage=" + totalPage + ", prePage=" + prePage + ", nextPage="
				+ nextPage + ", uname=" + uname + "]";
	}

}
